import {
  ADD_TODO,
} from "./constands";
// 添加
function addFn(todoName) {
  return { type: ADD_TODO, todoName };
}
// 为了配合redux-thunk,要在actions中定义异步代码
// 异步的action
function addFnAsync(todoName) {
  return (dispatch) => {
    //执行异步操作
    setTimeout(() => {                               
      dispatch(addFn(todoName))
    },300)
  }
}
export { addFn,addFnAsync };
